package dao

import "TodoList/models"

func AddTodo(Content string) (error, models.Todo) {
	var err error
	t := models.Todo{
		Content:    Content,
		IsFinished: false,
	}
	if err = PgDB.Create(&t).Error; err != nil {
		return err, models.Todo{}
	}
	return err, t
}
